# Copyright (C) 2023 Advanced Micro Devices, Inc.  All rights reserved.
set( CMAKE_EXPORT_COMPILE_COMMANDS ON)
set( CMAKE_INSTALL_MESSAGE LAZY)
set( CMAKE_C_COMPILER armr5-none-eabi-gcc )
set( CMAKE_CXX_COMPILER armr5-none-eabi-g++ )
set( CMAKE_C_COMPILER_LAUNCHER  )
set( CMAKE_CXX_COMPILER_LAUNCHER  )
set( CMAKE_ASM_COMPILER armr5-none-eabi-gcc )
set (CROSS_PREFIX           "armr5-none-eabi-" CACHE STRING "")
add_definitions( -DWITH_DOCS=OFF -DWITH_EXAMPLES=ON -DXPAR_SCUGIC_0_DEVICE_ID=XPAR_SCUGIC_SINGLE_DEVICE_ID -DXPAR_SCUGIC_0_DIST_BASEADDR=XPAR_SCUGIC_DIST_BASEADDR )
set( CMAKE_AR armr5-none-eabi-ar CACHE FILEPATH "Archiver" )
set( CMAKE_SIZE armr5-none-eabi-size CACHE FILEPATH "Size" )
set( CMAKE_SYSTEM_PROCESSOR "arm" )
set( MACHINE "zynqmp_r5")
set( CMAKE_SYSTEM_NAME "Generic" )
set( CMAKE_SPECS_FILE "$ENV{ESW_REPO}/scripts/specs/arm/Xilinx.spec" CACHE STRING "Specs file path for using CMAKE toolchain files" )
set( CMAKE_C_FLAGS "  -O0 -g -Wall -Wextra -fno-tree-loop-distribute-patterns -DARMR5 -mfpu=vfpv3-d16 -mfloat-abi=hard -mcpu=cortex-r5 -specs=${CMAKE_SPECS_FILE} -I${CMAKE_INCLUDE_PATH} " CACHE STRING "CFLAGS" )
set( CMAKE_CXX_FLAGS " -O0 -g -Wall -Wextra -fno-tree-loop-distribute-patterns -DARMR5 -mfpu=vfpv3-d16 -mfloat-abi=hard -mcpu=cortex-r5 -specs=${CMAKE_SPECS_FILE}" CACHE STRING "CFLAGS" )
set( CMAKE_ASM_FLAGS " -O0 -g -Wall -Wextra -fno-tree-loop-distribute-patterns -DARMR5 -mfpu=vfpv3-d16 -mfloat-abi=hard -mcpu=cortex-r5 -specs=${CMAKE_SPECS_FILE} -I${CMAKE_INCLUDE_PATH}" CACHE STRING "ASM FLAGS" )
set( CMAKE_C_LINK_FLAGS " -mfpu=vfpv3-d16 -mfloat-abi=hard -mcpu=cortex-r5 -DARMR5 -mcpu=cortex-r5 -pipe -g -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -L${CMAKE_LIBRARY_PATH}" CACHE STRING "LDFLAGS" )
set( CMAKE_CXX_LINK_FLAGS " -mfpu=vfpv3-d16 -mfloat-abi=hard -mcpu=cortex-r5 -DARMR5 -mcpu=cortex-r5 -pipe -g -feliminate-unused-debug-types -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed" CACHE STRING "LDFLAGS" )
set( CMAKE_C_FLAGS_RELEASE "-DNDEBUG" CACHE STRING "Additional CFLAGS for release" )
set( CMAKE_CXX_FLAGS_RELEASE "-DNDEBUG" CACHE STRING "Additional CXXFLAGS for release" )
set( CMAKE_ASM_FLAGS_RELEASE "-DNDEBUG" CACHE STRING "Additional ASM FLAGS for release" )
set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${proc_extra_compiler_flags}")
set( CMAKE_ASM_FLAGS "${CMAKE_ASM_FLAGS} ${proc_extra_compiler_flags}")
set (SOC_FAMILY "zynqmp")
